package com.sskj.one.login;

import com.sskj.common.base.HttpData;
import com.sskj.common.util.MD5Util;
import com.sskj.lib.http.JsonCallBack;
import com.sskj.one.bean.AccountBean;
import com.sskj.one.presenter.BasePresenter;


/**
 * @author Hey
 * Create at  2019/05/21
 */
class LoginPresenter extends BasePresenter<LoginActivity> {
    public void login(String mobile, String pwd) {
        httpService.login(mobile, MD5Util.getFiveMd5Value(pwd))
                .tag(this)
                .execute(new JsonCallBack<HttpData<AccountBean>>(this) {
                    @Override
                    public void onHTTPSuccess(HttpData<AccountBean> data) {
                        mView.loginSuccess(data.getData(), mobile);
                    }
                });
    }
}
